/*
    Copyright 2006 Andrew Wilkinson <andrew@indiegigs.co.uk>

    This file is part of libgp2x.

    libgp2x is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    libgp2x is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with libgp2x; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "gp2x_internal.h"
#include "gp2x_message.h"

volatile struct GP2x_message* GP2x_read_buffer;
volatile struct GP2x_message* GP2x_write_buffer;
volatile unsigned int* GP2x_read_buffer_read;
volatile unsigned int* GP2x_read_buffer_write;
volatile unsigned int* GP2x_write_buffer_read;
volatile unsigned int* GP2x_write_buffer_write;
volatile unsigned int* GP2x_return_ready;
volatile unsigned long* GP2x_return_value;

void GP2x_message_init() {
    GP2x_read_buffer = (struct GP2x_message*)(GP2x_940_BUFFER_START + GP2x_upper_memory);
    GP2x_write_buffer = (struct GP2x_message*)(GP2x_920_BUFFER_START + GP2x_upper_memory);
    GP2x_read_buffer_read = (unsigned int*)(GP2x_940_BUFFER_READ + GP2x_upper_memory);
    GP2x_read_buffer_write = (unsigned int*)(GP2x_940_BUFFER_WRITE + GP2x_upper_memory);
    GP2x_write_buffer_read = (unsigned int*)(GP2x_920_BUFFER_READ + GP2x_upper_memory);
    GP2x_write_buffer_write = (unsigned int*)(GP2x_920_BUFFER_WRITE + GP2x_upper_memory);
    GP2x_return_ready = (unsigned int*)(GP2x_RETURN_READY + GP2x_upper_memory);
    GP2x_return_value = (unsigned long*)(GP2x_RETURN_VALUE + GP2x_upper_memory);
}
